<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Mall extends Model
{
    protected $table = 'mall';

    const STATUS_1 = 1;//进行中
    const STATUS_2 = 2;//已结束

    const SORT_1 = 1;//置顶
    const SORT_0 = 0;//默认

    const STATUS_TEXT = [
        self::STATUS_1 => '<span class="el-tag">正常</span>',
        self::STATUS_2 => '<span class="el-tag el-tag--danger">下架</span>',
    ];

    const SORT_TEXT = [
        self::SORT_1 => '<span class="el-tag el-tag--danger">置顶</span>',
        self::SORT_0 => '<span class="el-tag">默认</span>',
    ];

    protected $fillable = [
        'name','prices','score','number','intro','thumb','details','status','changed','sort','created_at','updated_at'
    ];
//    public $timestamps = false;
    protected $dates = ['created_at','updated_at'];
    protected $casts = ['details'=>'array'];

}
